var express = require('express')
const Mock = require('mockjs')

var app = express()

let data = Mock.mock({
  'spots|1-10': [
    {
      'id|+1': 1,
      'name|1': [Mock.Random.name(), Mock.Random.name(), Mock.Random.name(), Mock.Random.name()],
    }
  ]
})

app.get('/', function (req, res) {
  res.send('Hello World')
})

app.get('/spots', (req, res) => {
  res.header('Access-Control-Allow-Origin', '*')
  setTimeout(() => {
    res.send(data.spots)
  }, 1000)
})

app.listen(6633)